Error DXL run through VBA

Dear DoorsUsers,

I have one code for put the data into current module, new created object. when i run following code in doors run this code properly but the this code dxl file i was run using VBA that time i got this error "null Object parameter was passed into argument position 1"

anybody give me solution

Module m = current
Object o= current
Object newo = create o
o."Object Text" = richClip
SystemAdmin - Fri Sep 16 06:00:52 EDT 2011

Re: Error DXL run through VBA
OurGuest - Fri Sep 16 09:43:59 EDT 2011

The problem is with this statement: Module m = current

When using VBA, current = null

Easiest solution perhaps is to use a read statement, setting m = read("yourmodule",...

Re: Error DXL run through VBA
llandale - Fri Sep 16 18:03:15 EDT 2011

Yes, you have a context problem. When you invoke DXL from the Explorer in knows the 'current Folder' and the 'current Project', and there is no 'current Module'. When you run DXL from an open module (pull down menu or open the DXL window with that module open) then there is a 'current Module'.

When you send DXL to DOORS such as through VBA, there is no 'current Module' and the DXL must appropriately defines its context. As OurGuest said you can get a module handle by issuing a 'read(NameFull)' statement and then setting that handle current = mod, or you could derive the current open Handle with perhaps "Module mod = module(item(NameFull))".

Notice the DXL you send via VBA will need to know the name of the module in question. If your VBA code is generic and "does something to the 'current' module" then you have a problem. You can perhaps get around that by having your VBA DXL code try to figure out which 'Module' is 'current' as far as the rest of DOORS is conserned. Since there may be more than module open you may need to do some trick about looking at Window handles and determine which is "on top", but I don't know how to do that (or if it can be done). You can perhaps loop through all the open modules in the database, picking the ONE that is open visibly, and if there are zero, or more than one visible then the DXL code decides not to do anything.

  • Louie

This context issue applies to Batch and DXL in the command line, and also to "eval_" code.

Re: Error DXL run through VBA
SystemAdmin - Mon Sep 19 00:21:53 EDT 2011

OurGuest - Fri Sep 16 09:43:59 EDT 2011
The problem is with this statement: Module m = current

When using VBA, current = null

Easiest solution perhaps is to use a read statement, setting m = read("yourmodule",...

As per your suggestion i solve my propble Thanks for the reply

Re: Error DXL run through VBA
SystemAdmin - Mon Sep 19 00:22:53 EDT 2011

llandale - Fri Sep 16 18:03:15 EDT 2011
Yes, you have a context problem. When you invoke DXL from the Explorer in knows the 'current Folder' and the 'current Project', and there is no 'current Module'. When you run DXL from an open module (pull down menu or open the DXL window with that module open) then there is a 'current Module'.

When you send DXL to DOORS such as through VBA, there is no 'current Module' and the DXL must appropriately defines its context. As OurGuest said you can get a module handle by issuing a 'read(NameFull)' statement and then setting that handle current = mod, or you could derive the current open Handle with perhaps "Module mod = module(item(NameFull))".

Notice the DXL you send via VBA will need to know the name of the module in question. If your VBA code is generic and "does something to the 'current' module" then you have a problem. You can perhaps get around that by having your VBA DXL code try to figure out which 'Module' is 'current' as far as the rest of DOORS is conserned. Since there may be more than module open you may need to do some trick about looking at Window handles and determine which is "on top", but I don't know how to do that (or if it can be done). You can perhaps loop through all the open modules in the database, picking the ONE that is open visibly, and if there are zero, or more than one visible then the DXL code decides not to do anything.

  • Louie

This context issue applies to Batch and DXL in the command line, and also to "eval_" code.

Thanks for the reply